package model.sys;

/**
 * @author futao
 * Created on 18-7-23-下午5:14.
 * 业务逻辑异常
 * 继承RuntimeException,而不是继承Exception
 * 因为Exception和Error是checkedException，必须在编译期间处理，所以必须throw或者try catch
 * RuntimeException为运行时异常，uncheckedException程序可以不处理
 */
public class BLogicException extends RuntimeException {
    private String code;
    private String message;

    public BLogicException() {
    }

    public BLogicException(String errorMessage) {
        this.code = errorMessage.substring(0, 8);
        this.message = errorMessage.substring(9);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
